package com.bt.lms.ui.action.teacher.basic.info;

import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.control.ComboBox;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;

/**
 * 新增学历学位信息事件
 */
public class EducationInfoAddBtn implements EventHandler {
    private VBox educationInfoVBox;
    private Integer width = 1280;
    private Integer height = 900;

    public EducationInfoAddBtn(VBox educationInfoVBox) {
        this.educationInfoVBox = educationInfoVBox;
    }

    @Override
    public void handle(Event event) {
        //数据盒子
        HBox dataHBox = new HBox();
        double dataHBoxHeight=height*0.2;
        dataHBox.setMaxHeight(dataHBoxHeight);
        dataHBox.setMinWidth(width*0.5);
        educationInfoVBox.getChildren().add(dataHBox);
        //左盒子
        VBox dataLeftVBox = new VBox();
        double dataLeftHBoxHeight=height*0.2;
        dataLeftVBox.setMaxHeight(dataLeftHBoxHeight);
        dataLeftVBox.setMinWidth(width*0.5);
        dataHBox.getChildren().add(dataLeftVBox);
        //入学年月盒子
        HBox timeHBox = new HBox();
        timeHBox.setPadding(new Insets(10,0,10,30));
        timeHBox.setSpacing(20);
        double timeHBoxHeight=height*0.05;
        timeHBox.setPrefHeight(timeHBoxHeight);
        timeHBox.setPrefWidth(width);
        Label timeLb = new Label("入学年月");
        timeLb.setPrefWidth(100);
        DatePicker startTimeDP = new DatePicker();
        timeHBox.getChildren().addAll(timeLb,startTimeDP);
        dataLeftVBox.getChildren().add(timeHBox);
        //毕肄业学校或单位
        HBox unitHBox = new HBox();
        unitHBox.setPadding(new Insets(10,0,10,30));
        unitHBox.setSpacing(20);
        double unitHBoxHeight=height*0.05;
        unitHBox.setPrefHeight(unitHBoxHeight);
        unitHBox.setPrefWidth(width);
        Label unitLb = new Label("毕肄业学校或单位");
        unitLb.setPrefWidth(100);
        TextField unitTF = new TextField();
        unitHBox.getChildren().addAll(unitLb,unitTF);
        dataLeftVBox.getChildren().add(unitHBox);
        //学习方式
        HBox studyWayHBox = new HBox();
        studyWayHBox.setPadding(new Insets(10,0,10,30));
        studyWayHBox.setSpacing(20);
        double studyWayHBoxHeight=height*0.05;
        studyWayHBox.setPrefHeight(studyWayHBoxHeight);
        studyWayHBox.setPrefWidth(width);
        Label studyWayLb = new Label("学习方式");
        studyWayLb.setPrefWidth(100);
        ComboBox<String> studyWayCom = new ComboBox<>();
        studyWayCom.getSelectionModel().select("请选择");
        studyWayCom.getItems().add("全脱产");
        studyWayCom.getItems().add("半脱产");
        studyWayCom.getItems().add("不脱产");
        studyWayHBox.getChildren().addAll(studyWayLb,studyWayCom);
        dataLeftVBox.getChildren().add(studyWayHBox);
        //学历
        HBox educationHBox = new HBox();
        educationHBox.setPadding(new Insets(10,0,10,30));
        educationHBox.setSpacing(20);
        double educationHBoxHeight=height*0.05;
        educationHBox.setPrefHeight(educationHBoxHeight);
        educationHBox.setPrefWidth(width);
        Label educationLb = new Label("学历");
        educationLb.setPrefWidth(100);
        ComboBox<String> educationCom = new ComboBox<>();
        educationCom.getSelectionModel().select("请选择");
        educationCom.getItems().add("研究生教育");
        educationCom.getItems().add("学士");
        educationCom.getItems().add("博士");
        educationCom.getItems().add("硕士");
        educationHBox.getChildren().addAll(educationLb,educationCom);
        dataLeftVBox.getChildren().add(educationHBox);
        //学历证书号
        HBox certificateIDHBox = new HBox();
        certificateIDHBox.setPadding(new Insets(10,0,10,30));
        certificateIDHBox.setSpacing(20);
        double certificateIDHeight=height*0.05;
        certificateIDHBox.setPrefHeight(certificateIDHeight);
        certificateIDHBox.setPrefWidth(width);
        Label certificateIDLb = new Label("学历证书号");
        certificateIDLb.setPrefWidth(100);
        TextField certificateIDTF = new TextField();
        certificateIDHBox.getChildren().addAll(certificateIDLb,certificateIDTF);
        dataLeftVBox.getChildren().add(certificateIDHBox);
        //授学位国家/地区
        HBox regionHBox = new HBox();
        regionHBox.setPadding(new Insets(10,0,10,30));
        regionHBox.setSpacing(20);
        double regionHBoxHeight=height*0.05;
        regionHBox.setPrefHeight(regionHBoxHeight);
        regionHBox.setPrefWidth(width);
        Label regionLb = new Label("授学位国家/地区");
        regionLb.setPrefWidth(100);
        TextField regionTF = new TextField();
        regionHBox.getChildren().addAll(regionLb,regionTF);
        dataLeftVBox.getChildren().add(regionHBox);
        //获学位日期
        HBox degreeTimeHBox = new HBox();
        degreeTimeHBox.setPadding(new Insets(10,0,10,30));
        degreeTimeHBox.setSpacing(20);
        double degreeTimeHBoxHeight=height*0.05;
        degreeTimeHBox.setPrefHeight(degreeTimeHBoxHeight);
        degreeTimeHBox.setPrefWidth(width);
        Label degreeTimeLb = new Label("获学位日期");
        degreeTimeLb.setPrefWidth(100);
        DatePicker degreeTimeDP = new DatePicker();
        degreeTimeHBox.getChildren().addAll(degreeTimeLb,degreeTimeDP);
        dataLeftVBox.getChildren().add(degreeTimeHBox);
        //学位证书号
        HBox degreeIDHBox = new HBox();
        degreeIDHBox.setPadding(new Insets(10,0,10,30));
        degreeIDHBox.setSpacing(20);
        double degreeIDHBoxHeight=height*0.05;
        degreeIDHBox.setPrefHeight(degreeIDHBoxHeight);
        degreeIDHBox.setPrefWidth(width);
        Label degreeIDLb = new Label("学位证书号");
        degreeIDLb.setPrefWidth(100);
        TextField degreeIDTF = new TextField();
        degreeIDHBox.getChildren().addAll(degreeIDLb,degreeIDTF);
        dataLeftVBox.getChildren().add(degreeIDHBox);

        //右盒子
        VBox dataRightVBox = new VBox();
        double dataRightVBoxHeight=height*0.2;
        dataRightVBox.setMaxHeight(dataRightVBoxHeight);
        dataRightVBox.setMinWidth(width*0.5);
        dataHBox.getChildren().add(dataRightVBox);
        //结束学业年月
        HBox stopStudyTimeHBox = new HBox();
        stopStudyTimeHBox.setPadding(new Insets(10,0,10,30));
        stopStudyTimeHBox.setSpacing(20);
        double stopStudyTimeHBoxHeight=height*0.05;
        stopStudyTimeHBox.setPrefHeight(stopStudyTimeHBoxHeight);
        stopStudyTimeHBox.setPrefWidth(width);
        Label stopStudyTimeLb = new Label("结束学业年月");
        stopStudyTimeLb.setPrefWidth(100);
        DatePicker stopStudyTimeDP = new DatePicker();
        stopStudyTimeHBox.getChildren().addAll(stopStudyTimeLb,stopStudyTimeDP);
        dataRightVBox.getChildren().add(stopStudyTimeHBox);
        //学习形式
        HBox learningStyleHBox = new HBox();
        learningStyleHBox.setPadding(new Insets(10,0,10,30));
        learningStyleHBox.setSpacing(20);
        double learningStyleHBoxHeight=height*0.05;
        learningStyleHBox.setPrefHeight(learningStyleHBoxHeight);
        learningStyleHBox.setPrefWidth(width);
        Label learningStyleLb = new Label("学习形式");
        learningStyleLb.setPrefWidth(100);
        ComboBox<String> learningStyleCom = new ComboBox<>();
        learningStyleCom.getSelectionModel().select("请选择");
        learningStyleCom.getItems().add("普通高等院校");
        learningStyleCom.getItems().add("高等教育自学考试");
        learningStyleCom.getItems().add("夜大学");
        learningStyleCom.getItems().add("职工大学");
        learningStyleHBox.getChildren().addAll(learningStyleLb,learningStyleCom);
        dataRightVBox.getChildren().add(learningStyleHBox);
        //所学专业
        HBox specialtyHBox = new HBox();
        specialtyHBox.setPadding(new Insets(10,0,10,30));
        specialtyHBox.setSpacing(20);
        double specialtyHBoxHeight=height*0.05;
        specialtyHBox.setPrefHeight(specialtyHBoxHeight);
        specialtyHBox.setPrefWidth(width);
        Label specialtyLb = new Label("所学专业");
        specialtyLb.setPrefWidth(100);
        TextField specialtyTF = new TextField();
        specialtyHBox.getChildren().addAll(specialtyLb,specialtyTF);
        dataRightVBox.getChildren().add(specialtyHBox);
        //学制
        HBox schoolSystemHBox = new HBox();
        schoolSystemHBox.setPadding(new Insets(10,0,10,30));
        schoolSystemHBox.setSpacing(20);
        double schoolSystemHBoxHeight=height*0.05;
        schoolSystemHBox.setPrefHeight(schoolSystemHBoxHeight);
        schoolSystemHBox.setPrefWidth(width);
        Label schoolSystemLb = new Label("学制");
        schoolSystemLb.setPrefWidth(100);
        TextField schoolSystemTF = new TextField();
        schoolSystemHBox.getChildren().addAll(schoolSystemLb,schoolSystemTF);
        dataRightVBox.getChildren().add(schoolSystemHBox);
        //授学位单位名称
        HBox giveDegreeHBox = new HBox();
        giveDegreeHBox.setPadding(new Insets(10,0,10,30));
        giveDegreeHBox.setSpacing(20);
        double giveDegreeHBoxHeight=height*0.05;
        giveDegreeHBox.setPrefHeight(giveDegreeHBoxHeight);
        giveDegreeHBox.setPrefWidth(width);
        Label giveDegreeLb = new Label("授学位单位名称");
        giveDegreeLb.setPrefWidth(100);
        TextField giveDegreeTF = new TextField();
        giveDegreeHBox.getChildren().addAll(giveDegreeLb,giveDegreeTF);
        dataRightVBox.getChildren().add(giveDegreeHBox);
        //获得学位
        HBox gainDegreeHBox = new HBox();
        gainDegreeHBox.setPadding(new Insets(10,0,10,30));
        gainDegreeHBox.setSpacing(20);
        double gainDegreeHBoxHeight=height*0.05;
        gainDegreeHBox.setPrefHeight(gainDegreeHBoxHeight);
        gainDegreeHBox.setPrefWidth(width);
        Label gainDegreeLb = new Label("获得学位");
        gainDegreeLb.setPrefWidth(100);
        ComboBox<String> gainDegreeCom = new ComboBox<>();
        gainDegreeCom.getSelectionModel().select("请选择");
        gainDegreeCom.getItems().add("无");
        gainDegreeCom.getItems().add("学士");
        gainDegreeCom.getItems().add("博士");
        gainDegreeCom.getItems().add("硕士");
        gainDegreeHBox.getChildren().addAll(gainDegreeLb,gainDegreeCom);
        dataRightVBox.getChildren().add(gainDegreeHBox);
        //获学位专业
        HBox giveDegreeSpecialtyHBox = new HBox();
        giveDegreeSpecialtyHBox.setPadding(new Insets(10,0,10,30));
        giveDegreeSpecialtyHBox.setSpacing(20);
        double giveDegreeSpecialtyHBoxHeight=height*0.05;
        giveDegreeSpecialtyHBox.setPrefHeight(giveDegreeSpecialtyHBoxHeight);
        giveDegreeSpecialtyHBox.setPrefWidth(width);
        Label giveDegreeSpecialtyLb = new Label("获学位专业");
        giveDegreeSpecialtyLb.setPrefWidth(100);
        TextField giveDegreeSpecialtyTF = new TextField();
        giveDegreeSpecialtyHBox.getChildren().addAll(giveDegreeSpecialtyLb,giveDegreeSpecialtyTF);
        dataRightVBox.getChildren().add(giveDegreeSpecialtyHBox);


    }
}
